<%--
  Created by IntelliJ IDEA.
  User: ndecreve
  Date: 03/05/12
  Time: 16:20
  To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
  <title>Simple GSP page</title>
  <meta name="layout" content="map">
  <gm:map points='${points}'/>
</head>

<body>
    <div id="mapContainer">
        <g:form method="get">
            <g:select name="tags"
                from="${ch.cern.Tag.listOrderByTag()}"
                value="${tags}"
                optionKey="id"
                multiple="true" /> <br />
            <g:datePicker name="fromDate" precision="day" value="${fromDate}"/> <br />
            <g:datePicker name="toDate" precision="day" value="${toDate}"/> <br />
            <g:actionSubmit action="all"
                value="${message(code: 'default.button.search.label', default: 'Search')}" />
        </g:form>
        
	    <div id="map_canvas" class="divmap"></div>
	</div>
    <div style="padding-left: 100px; padding-top: 30px">
        <h3>Stats</h3>
        <div>${stats.count} point(s) found</div>
        <div>${stats.fromDate.format("dd MMM yyyy")}
            - ${stats.toDate.format("dd MMM yyyy")}</div>

        <g:each in="${stats.tags}" var="tag">
            <div>
                ${tag.key} :
                    <g:each in="${tag.value}" var="point">
                        ${point},
                    </g:each>
            </div>
        </g:each>
    </div>
</body>
</html>